Python Automation & Data Analysis

Python Projects

Python scripts, Jupyter Notebooks, and automation workflows that transform raw datasets into scientific insights. Each project combines real-world data with reproducible analysis pipelines.

Stack: 🐍 Python 📊 Pandas & NumPy 🖼 Matplotlib & Seaborn 📑 Jupyter Notebook
3
Projects
5+
Study Sites
Geochem
Domain
USA
Region

Project 01 — Geochemical EDA

Perigo Mine EDA

Jupyter Notebook · Python · Geochemistry & Environmental Tracers · Colorado 2024

● Completed
Perigo Mine EDA Jupyter Notebook showing scatter plots, correlation heatmap, box plots, tracer time series, and piper diagram
🐍 Jupyter Notebook · Geochemistry EDA

🔗 View Full Notebook on GitHub

Complete Jupyter Notebook with all code, visualizations, and findings — fully reproducible.

🔗 Open on GitHub

📋 Project Overview

An Exploratory Data Analysis of geochemistry and environmental tracer data collected from groundwater and stream water at the Perigo Mine Site, Colorado (2024) — an abandoned mine site with active contaminant transport.

This project investigates groundwater–surface water interactions, contaminant pathways, and hydrological processes using Python, combining geological domain expertise with modern analytical methods.

  • Data Sources: 5 structured tables (sample sites, water chemistry, environmental tracers, field parameters)
  • Analysis: Statistical summaries, correlation matrices, bivariate plots, Piper diagram
  • Comparison: Groundwater vs. stream water chemical signatures
  • Tracers: Environmental isotopes and geochemical indicators
  • Output: Reproducible Jupyter Notebook with Matplotlib/Seaborn figures

📈 Project Stats

5
Data Files
2
Water Types
EDA
Analysis Type
2024
Field Season
CO
State, USA
.ipynb
Format

Notebook Structure

Analysis Pipeline

📦
Step 01
Data Import & Cleaning

Load and merge 5 structured CSV/Excel files. Handle missing values, standardize units, and validate sample site metadata.

🔍
Step 02
Exploratory Statistics

Descriptive statistics (mean, std, range) for all geochemical parameters split by water type: groundwater vs stream water.

📊
Step 03
Data Visualization

Scatter plots (Ca vs Mg, SO4 vs conductivity), box plots, histograms, and time series of tracer concentrations.

🕜
Step 04
Correlation Analysis

Pearson correlation heatmap across all geochemical parameters to identify co-varying species and contamination sources.

🗺
Step 05
Hydrogeochemical Plots

Piper diagram (trilinear plot) for water classification, identifying major ion facies and groundwater mixing relationships.

📝
Step 06
Findings & Interpretation

Synthesis of geochemical patterns, identification of contamination pathways, and hydrological process interpretation.

Code Preview

Sample — Correlation Heatmap

Perigo_Mine_EDA.ipynb Python
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

# Load and merge datasets
water_chem = pd.read_csv('Table2_WaterChemistry.csv')
tracers    = pd.read_csv('Table3_WaterEnvtTracers.csv')
df = water_chem.merge(tracers, on='SampleID')

# Correlation heatmap of geochemical parameters
fig, ax = plt.subplots(figsize=(12, 9))
corr = df.select_dtypes(include='number').corr()
sns.heatmap(corr, annot=True, fmt='.2f',
           cmap='coolwarm', center=0, ax=ax,
           linewidths=0.5, square=True)
ax.set_title('Correlation Heatmap -- Geochemical Parameters',
           fontsize=14, fontweight='bold')
plt.tight_layout()
plt.show()

Key Findings

Insights from Perigo Mine EDA

💧

Groundwater vs Stream Water

Distinct chemical signatures between water types, indicative of different recharge sources, flow paths, and subsurface residence times.

⚗

Sulfate as Contaminant Tracer

Elevated SO4 strongly correlates with conductivity, confirming sulfide mineral oxidation as the primary acid mine drainage pathway.

🕜

Strong Ca-Mg Correlation

Ca vs Mg scatter plots reveal carbonate mineral dissolution as a dominant weathering process controlling major ion chemistry at the site.

☕

Environmental Tracer Signals

Tracer data constrains groundwater age and mixing fractions, critical for understanding contaminant transport timescales from mine to stream.

🗺

Hydrogeochemical Facies

Piper diagram reveals Ca-SO4 and mixed facies water types, consistent with acid mine drainage-influenced groundwater chemistry.

♻

Reproducible Pipeline

The full workflow from raw CSV data to publication-quality figures is documented in a single Jupyter Notebook for complete reproducibility.

Project 02 — Petrological & Geochemical Analysis

Bio-oil Distillation Residues
vs Natural Solid Hydrocarbons

Jupyter Notebook · Python · Petrological & Geochemical Analysis · Utah & Texas, USA

● Completed
Bio-oil vs Natural Solid Hydrocarbons Jupyter Notebook showing Van Krevelen diagram, ternary plot, proximate analysis, calorific plot, correlation heatmap, and elemental analysis
🐍 Jupyter Notebook · Petrological & Geochemical Analysis

🔗 View Full Notebook on GitHub

Complete Jupyter Notebook with all petrological and geochemical analysis code, figures, and interpretation.

🔗 Open on GitHub

📋 Project Overview

A comprehensive petrological and geochemical analysis comparing fast pyrolysis bio-oil distillation residues with naturally formed solid fossil fuels — natural solid hydrocarbons and coal — collected from two major US study sites.

This project applies Python data science tools to characterize the elemental composition, proximate analysis, and geochemical properties of organic materials, bridging the gap between bio-energy products and conventional fossil fuel benchmarks.

  • Study Sites: Uinta Basin, Utah, USA & San Miguel Mine, Texas, USA
  • Sample Types: Bio-oil distillation residues, natural solid hydrocarbons, coal
  • Analysis: Van Krevelen diagram, proximate & ultimate analysis, calorific value comparison
  • Visualizations: Ternary plots, correlation heatmaps, elemental bar charts
  • Output: Reproducible Jupyter Notebook with Matplotlib/Seaborn scientific figures

📈 Project Stats

3
Sample Types
2
Study Sites
Van K.
Key Diagram
UT+TX
US States
Petro
Domain
.ipynb
Format

Notebook Structure

Analysis Pipeline

📦
Step 01
Data Loading & Preprocessing

Import petrological and geochemical datasets. Clean, validate, and standardize proximate/ultimate analysis values and elemental composition data.

🗺
Step 02
Van Krevelen Diagram

Plot H/C vs O/C atomic ratios for all sample types to classify organic matter and compare bio-oil residues against natural hydrocarbons and coal benchmarks.

📊
Step 03
Proximate Analysis

Compare moisture, ash, volatile matter, and fixed carbon content across bio-oil residues, natural solid hydrocarbons, and coal using box plots and bar charts.

⚖
Step 04
Ultimate (Elemental) Analysis

Visualize C, H, N, S, O elemental composition differences between Uinta Basin (Utah) and San Miguel Mine (Texas) sample groups using grouped bar charts.

🔥
Step 05
Calorific Value Analysis

Scatter plot of calorific value vs carbon content to evaluate energy density relationships between bio-oil residues and reference fossil fuel materials.

🕜
Step 06
Geochemical Correlations & Insights

Correlation heatmap and ternary C-H-O plot to identify geochemical relationships and distinguish the chemical fingerprints of each material class.

Code Preview

Sample — Van Krevelen Diagram

Petrological_Analysis.ipynb Python
import pandas as pd
import matplotlib.pyplot as plt

# Load geochemical dataset
dataset = pd.read_excel('geochemical_data.xlsx')

# Compute atomic H/C and O/C ratios for Van Krevelen diagram
dataset['H_C'] = (dataset['H_wt'] / 1.008) / (dataset['C_wt'] / 12.011)
dataset['O_C'] = (dataset['O_wt'] / 15.999) / (dataset['C_wt'] / 12.011)

# Plot Van Krevelen diagram
fig, ax = plt.subplots(figsize=(9, 6))
for sample_type, group in dataset.groupby('Sample_Type'):
    ax.scatter(group['O_C'], group['H_C'],
               label=sample_type, alpha=0.75, s=60)

ax.set_xlabel('O/C Atomic Ratio')
ax.set_ylabel('H/C Atomic Ratio')
ax.set_title('Van Krevelen Diagram -- Bio-oil vs Natural Solid Fuels')
ax.legend()
plt.tight_layout()
plt.show()

Key Findings

Insights from the Analysis

🗺

Distinct Van Krevelen Clusters

Bio-oil distillation residues occupy a distinct H/C vs O/C region separate from natural solid hydrocarbons, reflecting their unique pyrolysis-derived organic chemistry.

📈

Proximate Analysis Contrast

Bio-oil residues show markedly higher volatile matter and lower fixed carbon compared to coal, indicating their thermally labile character and biogenic origin.

📍

Site-Specific Signatures

Uinta Basin (Utah) and San Miguel Mine (Texas) samples display characteristic elemental differences, reflecting distinct depositional environments and thermal maturity.

🔥

Calorific Value Range

Strong positive correlation between carbon content and calorific value across all sample types, validating carbon as the primary energy carrier in both fossil and bio-derived materials.

⚖

Elemental Composition Overlap

Surprising chemical similarities between bio-oil residues and natural solid hydrocarbons in C and H content suggest potential for valorization as solid fuel substitutes.

♻

Reproducible Workflow

All analyses from raw Excel data to publication-quality scientific figures are captured in a single documented Jupyter Notebook, fully reproducible by any researcher.

Project 03 — Geochemical & Petrographic Analysis

Coal Waste Geochemistry
Historic Anthracite Mining, Pennsylvania

Jupyter Notebook · Python · Geochemical & Petrographic Analysis · Luzerne County, Pennsylvania, USA · 2024

● Completed
Coal Waste Geochemical Analysis Jupyter Notebook showing sample location map, proximate analysis, elemental composition, heavy metal concentrations, rare earth elements, and float-sink separation
🐍 Jupyter Notebook · Geochemical & Petrographic Analysis

🔗 View Full Notebook on GitHub

Complete Jupyter Notebook with geochemical analysis, heavy metal screening, REE profiling, and float-sink separation data — fully reproducible.

🔗 Open on GitHub

📋 Project Overview

A comprehensive geochemical and petrographic analysis of coal refuse (culm) samples collected from a historic anthracite coal mining region in Luzerne County, Pennsylvania (2024) — assessing environmental contamination, mineral chemistry, and legacy remediation effectiveness.

This project applies Python to characterize the proximate, ultimate, and geochemical properties of coal waste piles, including heavy metal screening, rare earth element (REE) profiling, and float-sink separation analysis across 9 sample sites with varying remediation histories.

  • Sample Sites: 9 coal refuse sites, Luzerne County, Pennsylvania — including lime-remediated and untreated areas
  • Data Tables: Sample metadata, proximate/ultimate analysis, multi-element geochemistry (ICP/INAA), float-sink separation
  • Analysis: Proximate & ultimate analysis, heavy metal concentrations (Ni, Cu, Pb, Zn, As), REE profiling, sulfur speciation
  • Visualizations: Sample location maps, geochemical scatter plots, bar charts, heatmaps, float-sink profiles
  • Output: Reproducible Jupyter Notebook with Matplotlib/Seaborn scientific figures and interactive Folium map

📈 Project Stats

9
Sample Sites
4
Data Tables
60+
Parameters
REE
Key Analysis
PA
State, USA
.ipynb
Format

Notebook Structure

Analysis Pipeline

📦
Step 01
Data Import & Merging

Load and merge 4 structured CSV tables (sample metadata, proximate/ultimate analysis, multi-element geochemistry, float-sink data) by Sample ID.

📍
Step 02
Sample Location Mapping

Interactive Folium map of 9 coal refuse sites in Luzerne County, PA, color-coded by remediation status (lime-treated vs untreated).

📊
Step 03
Proximate & Ultimate Analysis

Compare ash content, volatile matter, fixed carbon, and heating values across sites. Plot CHNS elemental composition and sulfur speciation (pyritic, sulfate, organic).

⚖
Step 04
Heavy Metal Screening

Analyze Ni, Cu, Pb, Zn, Cd, As concentrations via TD-ICP and INAA. Compare raw vs. sink fractions and assess exceedances vs. regulatory thresholds.

🔬
Step 05
Rare Earth Element (REE) Profiling

Plot chondrite-normalized REE patterns (La to Lu) from FUS-MS data to characterize the geochemical fingerprint of coal refuse and assess REE enrichment potential.

🕜
Step 06
Float-Sink Separation Analysis

Evaluate washability data (float at SG 1.60 vs. sink) for ash, volatile matter, sulfur, and heating value — assessing coal recovery potential from waste piles.

Code Preview

Sample — Heavy Metal Bar Chart

Coal_Waste_Analysis.ipynb Python
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

# Load and merge geochemical tables
meta    = pd.read_csv('Table1.csv')
prox    = pd.read_csv('Table2.csv')
geochem = pd.read_csv('Table3.csv')
df = meta.merge(prox, on='SampleID').merge(geochem, on='SampleID')

# Heavy metal bar chart (Ni, Cu, Pb, Zn, As)
metals = ['Ni_TD-ICP_ppm', 'Cu_TD-ICP_ppm', 'Pb_TD-ICP_ppm',
           'Zn_TD-ICP_ppm', 'As_INAA_ppm']
raw_ws = df[df['Basis'] == 'ws'].copy()

x = np.arange(len(raw_ws))
fig, ax = plt.subplots(figsize=(13, 5))
for i, metal in enumerate(metals):
    ax.bar(x + i * 0.15, raw_ws[metal], width=0.14, label=metal.split('_')[0])
ax.set_xticks(x + 0.3)
ax.set_xticklabels(raw_ws['SampleID'], rotation=45, ha='right')
ax.set_ylabel('Concentration (ppm)')
ax.set_title('Heavy Metal Concentrations in Coal Refuse -- Luzerne Co., PA')
ax.legend()
plt.tight_layout()
plt.show()

Key Findings

Insights from Coal Waste Analysis

🔥

High-Ash Waste Piles

Most samples exceed 60% ash content (dry basis), confirming these are low-grade coal refuse culm piles with limited remaining fuel value but significant mineral matrix.

⚗

Sulfur Speciation & AMD Risk

Pyritic sulfur dominates in untreated sites, signaling active acid mine drainage generation potential; lime-remediated sites show suppressed sulfate mobility and lower sulfur content.

⚖

Heavy Metal Enrichment

Elevated Ni, Cu, Zn, and As concentrations in sink fractions relative to float material, indicating preferential partitioning of heavy metals into the denser, mineral-rich fraction of the refuse.

🔬

REE Recovery Potential

Rare earth element concentrations (La, Ce, Nd, Y) in the coal ash fraction suggest potential economic recovery interest, consistent with growing interest in coal waste as a critical minerals source.

🌿

Lime Remediation Contrast

Sites with historic lime application (circa 2015) show visibly different geochemical profiles — higher moisture, lower pyritic sulfur — demonstrating measurable remediation effects a decade later.

🕜

Washability & Coal Recovery

Float-sink analysis reveals that certain sites (e.g., NCAQ4, NCAQ9) retain a recoverable float fraction with heating values exceeding 10,000 BTU/lb, suggesting economic reprocessing potential for select refuse piles.

Under the Hood

Libraries & Techniques

The Python data science tools and methods applied in this project.

Pandas

Data loading, merging, cleaning, and aggregation across multiple structured CSV and Excel files.

NumPy

Numerical operations, array manipulations, and statistical calculations on geochemical parameter arrays.

Matplotlib

Multi-panel figure layouts, scatter plots, time series, box plots, and hydrogeochemical diagrams.

Seaborn

Correlation heatmaps, statistical distribution plots, and enhanced aesthetic styling for publication quality.

Piper Diagram

Hydrogeochemical classification of water samples using trilinear plots to identify water type facies.

Descriptive Statistics

Summary statistics (mean, median, std, IQR) per water type group for all geochemical parameters.

Correlation Analysis

Pearson correlation matrices to identify co-varying geochemical species and infer mineral weathering processes.

Multi-Table Merge

Joining 5 datasets across sample site metadata, water chemistry, and environmental tracers by Sample ID.

Jupyter Notebook

Interactive cell-by-cell analysis with inline visualizations, markdown documentation, and reproducible execution.

Let's collaborate on your next Python project!

Interested in my Python work?

I am open to data analyst roles, Python projects, and scientific data collaborations.